<!DOCTYPE html>
<html lang="en">

<head>
    <link rel="stylesheet" href="./css/flip.css">
    <link rel="stylesheet" href="./css/pc.css">
    <link rel="shortcut icon" href="./images/favicon.ico" type="image/x-icon">
    <!--IOS Icon-->
    <!-- <link rel="apple-touch-icon-precomposed" href="@Url.Content("~/Content/res/imgs/touch-icon-iphone.png")" />
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="@Url.Content("~/Content/res/imgs/touch-icon-ipad.png")" />
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="@Url.Content("~/Content/res/imgs/touch-icon-iphone-retina.png")" /> -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="@Url.Content(" ./images/4.png")" />
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Anniversary</title>
</head>

<body>
    <!-- <video controls="false" autoplay="true" name="media"> <source src="./music/Carry You.mp3" type="audio/mpeg"></video> -->

    <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=470547416&auto=1&height=66"></iframe>

    <img class=".bg-img" src="https://s3.ax1x.com/2021/01/17/ssnFPI.jpg" alt="">

    <div class="main">

        <div class="tick" data-did-init="startDateCountUp">

            <div class="title">胡胡和胖胖已经在一起</div>

            <div data-repeat="true" data-layout="horizontal center fit" data-transform="preset(d, h, m, s) -> delay">

                <div class="tick-group">

                    <div data-key="value" data-repeat="true" data-transform="pad(00) -> split -> delay">

                        <span data-view="flip"></span>

                    </div>

                    <span data-key="label" data-view="text" class="tick-label"></span>

                </div>

            </div>

        </div>

    </div>

    <footer class="translucent">

        <div>

            <a href="https://hugaotuan.top/">&copy; 2021 胡睿</a>

            <span class="hide-on-mobile"> | <a href="http://www.xiyou.edu.cn/" rel="noopener">西安邮电大学</a> | </span>

            <a href="https://surpasshr.github.io/lyd/photowall.html">照片墙 | </a>

            <span id="busuanzi_container_page_pv">
                本页面访问量<span id="busuanzi_value_page_pv"></span>次
            </span>

        </div>

    </footer>

</body>

<script>
    //判断是否移动端，如果是则跳转到指定的URL地址
    function browserRedirect(url) {
        //只读的字符串，声明了浏览器用于 HTTP 请求的用户代理头的值
        var sUserAgent = navigator.userAgent.toLowerCase();
        var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
        var bIsMidp = sUserAgent.match(/midp/i) == "midp";
        var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
        var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
        var bIsAndroid = sUserAgent.match(/android/i) == "android";
        var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
        var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
        if (bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
            window.location.replace(url);
        }
    }

    browserRedirect("https://surpasshr.github.io/lyd/mobile_page.html");

    var snowConfig = {
        color: [266 / 256, 266 / 256, 170 / 256],
        count: 1000,
        opacity: 0.8,
        density: 1 / 200,
    };

    function startDateCountUp(tick) {
        var locale = {
            YEAR_PLURAL: 'Jaren',
            YEAR_SINGULAR: 'Jaar',
            MONTH_PLURAL: 'Maanden',
            MONTH_SINGULAR: 'Maand',
            WEEK_PLURAL: 'Weken',
            WEEK_SINGULAR: 'Week',
            DAY_PLURAL: '天',
            DAY_SINGULAR: '天',
            HOUR_PLURAL: '小时',
            HOUR_SINGULAR: '小时',
            MINUTE_PLURAL: '分钟',
            MINUTE_SINGULAR: '分钟',
            SECOND_PLURAL: '秒',
            SECOND_SINGULAR: '秒',
            MILLISECOND_PLURAL: 'Milliseconden',
            MILLISECOND_SINGULAR: 'Milliseconde'
        };

        for (var key in locale) {
            if (!locale.hasOwnProperty(key)) {
                continue;
            }
            tick.setConstant(key, locale[key]);
        }
        var counter = Tick.count.up('2021-01-01T02:14:00');
        counter.onupdate = function(value) {
            // by default value will contain an
            // array with days, hours, minutes, seconds
            tick.value = value;
        };
    }


    //移动端网页适配
    (function(win, lib) {
        var doc = win.document; //当前文档对象
        var docEl = doc.documentElement; //文档对象根元素的只读属性
        var metaEl = doc.querySelector('meta[name="viewport"]');
        var flexibleEl = doc.querySelector('meta[name="flexible"]');
        var dpr = 0;
        var scale = 0;
        var tid;
        var flexible = lib.flexible || (lib.flexible = {});

        if (metaEl) {
            //当meta中viewport的标签设置了scale时，将根据scale手动设置dpr
            console.warn('将根据已有的meta标签来设置缩放比例');
            var match = metaEl.getAttribute('content').match(/initial\-scale=([\d\.]+)/);
            if (match) {
                scale = parseFloat(match[1]);
                dpr = parseInt(1 / scale);
            }
        } else if (flexibleEl) {
            //当meta中flexible的标签存在时，据此设置dpr
            var content = flexibleEl.getAttribute('content');
            if (content) {
                var initialDpr = content.match(/initial\-dpr=([\d\.]+)/);
                var maximumDpr = content.match(/maximum\-dpr=([\d\.]+)/);
                if (initialDpr) {
                    dpr = parseFloat(initialDpr[1]);
                    scale = parseFloat((1 / dpr).toFixed(2));
                }
                if (maximumDpr) {
                    dpr = parseFloat(maximumDpr[1]);
                    scale = parseFloat((1 / dpr).toFixed(2));
                }
            }
        }

        if (!dpr && !scale) {
            //根据js获取到的devicePixelRatio设置dpr及scale，scale是dpr的倒数
            var isAndroid = win.navigator.appVersion.match(/android/gi);
            var isIPhone = win.navigator.appVersion.match(/iphone/gi);
            var devicePixelRatio = win.devicePixelRatio;
            if (isIPhone) {
                // iOS下，对于2和3的屏，分别用2和3倍方案
                if (devicePixelRatio >= 3 && (!dpr || dpr >= 3)) {
                    dpr = 3;
                } else if (devicePixelRatio >= 2 && (!dpr || dpr >= 2)) {
                    dpr = 2;
                } else {
                    dpr = 1;
                }
            } else {
                // 其他设备下，仍旧使用1倍的方案
                dpr = 1;
            }
            scale = 1 / dpr;
        }

        docEl.setAttribute('data-dpr', dpr);
        //文本字号不建议使用rem，flexible适配方案中，文本使用px作为单位，使用[data-dpr]属性来区分不同dpr下的文本字号

        if (!metaEl) {
            //添加meta标签，设置name为viewport，content根据scale设置缩放比(默认、最大、最小缩放比)
            metaEl = doc.createElement('meta');
            metaEl.setAttribute('name', 'viewport');
            metaEl.setAttribute('content', 'initial-scale=' + scale + ', maximum-scale=' + scale + ', minimum-scale=' + scale + ', user-scalable=no');
            if (docEl.firstElementChild) {
                docEl.firstElementChild.appendChild(metaEl);
            } else {
                var wrap = doc.createElement('div');
                wrap.appendChild(metaEl);
                doc.write(wrap.innerHTML);
            }
        }

        function refreshRem() {
            //更新rem值
            var width = docEl.getBoundingClientRect().width;
            if (width / dpr > 540) {
                width = 540 * dpr;
            }
            var rem = width / 10; //1rem = viewWidth / 10
            docEl.style.fontSize = rem + 'px';
            flexible.rem = win.rem = rem;
        }

        //resize与pageshow延时300ms触发refreshRem(),使用防抖函数，防止事件被高频触发可能引起性能问题
        win.addEventListener('resize', function() {
            clearTimeout(tid);
            tid = setTimeout(refreshRem, 300);
        }, false);
        win.addEventListener('pageshow', function(e) {
            //当一条会话历史纪录被执行的时候触发事件，包括后退/前进按钮，同时会在onload页面触发后初始化页面时触发
            if (e.persisted) { //表示网页是否来自缓存
                clearTimeout(tid);
                tid = setTimeout(refreshRem, 300);
            }
        }, false);

        //在html文档加载和解析完成后设置body元素字体大小
        if (doc.readyState === 'complete') {
            doc.body.style.fontSize = 12 * dpr + 'px';
        } else {
            doc.addEventListener('DOMContentLoaded', function(e) {
                doc.body.style.fontSize = 12 * dpr + 'px';
            }, false);
        }
        //浏览器有最小字体限制，css在pc上font-size是12px(移动端最小是8px), 也就是css像素是12，其DPR为1，在移动端dpr有可能为2和3，为了保证字体不变小，需要用12*dpr进行换算。

        refreshRem();

        //实现rem与px相互转换
        flexible.dpr = win.dpr = dpr;
        flexible.refreshRem = refreshRem;
        flexible.rem2px = function(d) {
            var val = parseFloat(d) * this.rem;
            if (typeof d === 'string' && d.match(/rem$/)) {
                val += 'px';
            }
            return val;
        }
        flexible.px2rem = function(d) {
            var val = parseFloat(d) / this.rem;
            if (typeof d === 'string' && d.match(/px$/)) {
                val += 'rem';
            }
            return val;
        }

    })(window, window['lib'] || (window['lib'] = {}));
</script>
<!-- 翻页时钟 -->
<script src="./js/flip.js"></script>
<!-- 雪花飞舞 -->
<script type="text/javascript" src="./js/snowflakes.js" defer></script>
<!-- 页面访问量统计 -->
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

</html>